/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ssdhddsimulator;

/**
 *
 * @author Ammar Husain
 */
    public class SSD {



    static double SSDCalculator(String fileOperation, double fileSize, int offset) {


        int OperationID;
        double SSDTime;
        double SSDPower;
        double Read;
        double Write;
        double ActivePower;

        //Calculating Read/Write Times
        //Refer to Intel® X18-M/X25-M SATA Solid State Drive Datasheet for specs
        //Need to be validated

        Read = 250; //MB per s
        Write = 70; //MB per s

        //Assuming filesize and offset are in MB
        if(fileOperation.equals("R"))
            SSDTime = (fileSize - offset)/Read;
        else
             SSDTime = (fileSize - offset)/Write;

        ActivePower = 150; //mW

        //Power consumed in the Operation
        //Assuming drive is active only during the Operation time
        SSDPower = SSDTime*ActivePower;

        //Returning only time for now
        return SSDTime;



    }

    //Store the size of the file
    double fileSize;
    double readtime  = 54272;
    double writetime = 30720;
    //Set the file size according to input
    SSD()
    {
    }

    //TODO:Compute SSD output according to
    //the data sheet of SSD
    double SSDReadtime(double size)
    {
        return size/readtime;
    }

    double SSDWritetime(double size)
    {
        return size/writetime;
    }

    

    }



